﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using SzCourt.Logic.BLL;
using KMFrame.Core;

namespace SzCourt.WebSite.shenwu
{
    public partial class index : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!this.IsPostBack)
            {
                #region 法院公告
                getListrptft();
                getListSDGG();
                getListPGJGMD();
                getListZJJGGG();
                getListDCLXZWLGG();
                getListZFL();
                getListPCGG();
                getListQTGG();
                #endregion

                #region 执行公开
                getListZZGG();
                getListZXFLGZ();
                getListZXGZDT();
                getListZXGS();
                #endregion

                #region 工作报告
                getListZYBG();
                getListSPGZ();
                #endregion

                #region 裁判文书
                getrptcp1();
                getrptcp2();
                getrptcp3();
                getrptcp4();
                #endregion

            }
        }

        #region 法院公告方法
        /// <summary>
        /// 法庭公告
        /// </summary>
        private void getListrptft()
        {
            Court art = new Court();
            object o = art.GetCourtNoticeTop();
            if (o != null)
            {
                this.rptft.DataSource = o;
                this.rptft.DataBind();
                this.hdntabgendong1.Value = this.rptft.Items.Count.ToString();
            }
        }

        /// <summary>
        /// 送达公告
        /// </summary>
        private void getListSDGG()
        {           
            Articles art = new Articles();
            object o = art.GetArticlesTop(ArticlesTypes.SDGG);
            if (o != null)
            {
                this.rptDataListSDGG.DataSource = o;
                this.rptDataListSDGG.DataBind();
            }
        }

        /// <summary>
        /// 评估拍卖机构名单
        /// </summary>
        private void getListPGJGMD()
        {

            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.PGJGMD);
            if (result != null)
            {
                this.rptPGJGMD.DataSource = result;
                this.rptPGJGMD.DataBind();
            }
        }

        /// <summary>
        /// 中介机构公告
        /// </summary>
        private void getListZJJGGG()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZJJGGG);
            if (result != null)
            {
                this.rptZJJGGG.DataSource = result;
                this.rptZJJGGG.DataBind();
            }
        }

        /// <summary>
        /// 督促履行债务令公告
        /// </summary>
        private void getListDCLXZWLGG()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.DCLXZWLGG);
            if (result != null)
            {
                this.rptDCLXZWLGG.DataSource = result;
                this.rptDCLXZWLGG.DataBind();
            }
        }

        /// <summary>
        /// 支付令
        /// </summary>
        private void getListZFL()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZFL);
            if (result != null)
            {
                this.rptZFL.DataSource = result;
                this.rptZFL.DataBind();
            }
        }

        /// <summary>
        /// 破产公告
        /// </summary>
        private void getListPCGG()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.PCGG);
            if (result != null)
            {
                this.rptPCGG.DataSource = result;
                this.rptPCGG.DataBind();
            }
        }

        /// <summary>
        /// 其他公告
        /// </summary>
        private void getListQTGG()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.QTGG);
            if (result != null)
            {
                this.rptQTGG.DataSource = result;
                this.rptQTGG.DataBind();
            }
        }

        #endregion

        #region 执行公开方法

        /// <summary>
        /// 执行公告
        /// </summary>
        private void getListZZGG()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZZGG);
            if (result != null)
            {
                this.rptZXGG.DataSource = result;
                this.rptZXGG.DataBind();
            }
        }
        /// <summary>
        /// 执行法律法规规章
        /// </summary>
        private void getListZXFLGZ()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZXFLGZ);
            if (result != null)
            {
                this.rptZXFLGZ.DataSource = result;
                this.rptZXFLGZ.DataBind();
            }
        }

        /// <summary>
        /// 执行工作动态
        /// </summary>
        private void getListZXGZDT()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZXGZDT);
            if (result != null)
            {
                this.rptZXGZDT.DataSource = result;
                this.rptZXGZDT.DataBind();
            }
        }

        /// <summary>
        /// 执行故事
        /// </summary>
        private void getListZXGS()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZXGS);
            if (result != null)
            {
                this.rptZXGS.DataSource = result;
                this.rptZXGS.DataBind();
            }
        }

        #endregion

        #region 中院报告
        /// <summary>
        /// 中院报告
        /// </summary>
        private void getListZYBG()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.ZYBG);
            if (result != null)
            {
                this.rptZYBG.DataSource = result;
                this.rptZYBG.DataBind();
            }
        }

        #endregion

        #region 审判工作白皮书
        /// <summary>
        /// 审判工作白皮书
        /// </summary>
        private void getListSPGZ()
        {
            Articles art = new Articles();
            object result = art.GetArticlesTop(ArticlesTypes.SPGZ);
            if (result != null)
            {
                this.rptSPGZ.DataSource = result;
                this.rptSPGZ.DataBind();
            }
        }

        #endregion

        #region 裁判文书方法
        /// <summary>
        /// 获取裁判文书刑事
        /// </summary>
        private void getrptcp1()
        {
            RefereeDoc bll = new RefereeDoc();
            object o = bll.GetRefereeDocTop("刑事");

            if (o != null)
            {
                this.rptcp1.DataSource = o;
                this.rptcp1.DataBind();
                this.hdntabgendong2.Value = this.rptcp1.Items.Count.ToString();
            }
        }

        /// <summary>
        /// 获取裁判文书民事
        /// </summary>
        private void getrptcp2()
        {
            RefereeDoc bll = new RefereeDoc();
            object o = bll.GetRefereeDocTop("民事");

            if (o != null)
            {
                this.rptcp2.DataSource = o;
                this.rptcp2.DataBind();
                this.hdntabgendong3.Value = this.rptcp2.Items.Count.ToString();
            }
        }

        /// <summary>
        /// 获取裁判文书商事
        /// </summary>
        private void getrptcp3()
        {
            RefereeDoc bll = new RefereeDoc();
            object o = bll.GetRefereeDocTop("商事");

            if (o != null)
            {
                this.rptcp3.DataSource = o;
                this.rptcp3.DataBind();
                this.hdntabgendong4.Value = this.rptcp3.Items.Count.ToString();
            }
        }

        /// <summary>
        /// 获取裁判文书行政
        /// </summary>
        private void getrptcp4()
        {
            RefereeDoc bll = new RefereeDoc();
            object o = bll.GetRefereeDocTop("行政");

            if (o != null)
            {
                this.rptcp4.DataSource = o;
                this.rptcp4.DataBind();
                this.hdntabgendong5.Value = this.rptcp4.Items.Count.ToString();
            }
        }

        #endregion

    }
}